<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon">
	<title>react_props</title>
</head>
<body>
  <div id="test1"></div>
  <div id="test2"></div>

  <script type="text/javascript" src="../../js/react.development.js" ></script>
  <script type="text/javascript" src="../../js/react-dom.development.js"></script>
  <script type="text/javascript" src="../../js/babel.min.js"></script>

  <script type="text/babel">
    class Person extends React.Component {
      render(){
        const {name, age, sex} = this.props;
        return (<ul>
          <li>{name}</li>
          <li>{age}</li>
          <li>{sex}</li>
          </ul>)
      }
    }
    const p = {name:"jamie", age:18, sex:"女"}

    ReactDOM.render(<Person name="tom" age={18} sex="女"/>, document.getElementById('test1'));
    //ReactDOM.render(<Person name="jerry" age={19} sex="男"/>, document.getElementById('test2'));
    ReactDOM.render(<Person {...p} />, document.getElementById('test2'));
  </script>
</body>